<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>会员卡详细信息</title>
<meta name="decorator" content="default" />
<style>
</style>
<script type="text/javascript">
	$().ready(function() {
		disableExitMenu();
	});
</script>
</head>
<body>
	<nav data-role="navbar">
		<ul>
			<li><a data-ajax="false"
				href="${ctx}/cash/member/info?id=${member.customer.id}">会员基本信息</a></li>
			<li><a data-ajax="false"
				href="${ctx}/cash/member/cardsInfo?id=${member.customer.id}"
				class="ui-btn-active">会员卡信息</a></li>
			<li><a data-ajax="false"
				href="${ctx}/cash/member/historyConsumeList?id=${member.customer.id}">会员消费信息</a></li>
		</ul>
	</nav>
	<div class="container form-input">
		<div class="icon-buttons">
			<input type="button" data-inline="true" data-icon="back"
				onclick="return directOpenURL('${ctx}/cash/member/detail?id=${member.customer.id}')"
				data-iconpos="notext" value=" 返回" />
		</div>


		<c:if test="${member.currentCards.timesCards[0]!=null}">
			<div id="card_times">
				<table id="contentTable" data-role="table"
					class="ui-responsive table-stroke">
					<thead>
						<tr>
							<th colspan="6" style="text-align:center;">计次护理卡</th>
						</tr>
						<tr>
							<th>卡名</th>
							<th>护理项目</th>
							<th>护理间隔</th>
							<!--<th>总次数</th>  -->
							<th>剩余次数</th>
							<th>开卡时间</th>
							<!--<th>零售价</th>
						<th>店面优惠价</th> -->
							<th>当前状态</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${member.currentCards.timesCards}" var="card">
							<tr>
								<td>${card.template.name}</td>
								<c:if test="${card.template.storeCare.care_type==0}">
									<td>${card.template.storeCare.care.name}</td>
									<td>${card.template.storeCare.care.duration}天</td>
								</c:if>
								<c:if test="${card.template.storeCare.care_type==1}">
									<td>${card.template.storeCare.storeSelfCare.name}</td>
									<td>${card.template.storeCare.storeSelfCare.duration}天</td>
								</c:if>
								<!--<td>${card.template.times} 次</td> -->
								<td>${card.remainTimes}次</td>
								<td>${fns:formatDate(card.beginTime, "yyyy-MM-dd
									HH:mm:ss")}</td>
								<!--<td>${card.template.retail_price}</td>
							<td>${card.template.real_cost}</td>-->
								<td>${card.status==0?'可用':'不可用'}</td>
							</tr>
						</c:forEach>

					</tbody>
				</table>
			</div>
		</c:if>
		<c:if test="${member.currentCards.durationCards[0]!=null}">
			<br />
			<div id="card_duration">
				<table id="contentTable" data-role="table"
					class="ui-responsive table-stroke">
					<thead>
						<tr>
							<th colspan="10" style="text-align:center;">时段护理卡</th>
						</tr>
						<tr>
							<th>卡名</th>
							<th>护理项目</th>
							<th>护理间隔</th>
							<th>护理时段</th>
							<th>开卡时间</th>
							<th>终止时间</th>
							<!--<th>零售价</th>
						<th>店面优惠价</th>-->
							<th>当前状态</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${member.currentCards.durationCards}" var="card">
							<tr>
								<td>${card.template.name}</td>
								<c:if test="${card.template.storeCare.care_type==0}">
									<td>${card.template.storeCare.care.name}</td>
									<td>${card.template.storeCare.care.duration}天</td>
								</c:if>
								<c:if test="${card.template.storeCare.care_type==1}">
									<td>${card.template.storeCare.storeSelfCare.name}</td>
									<td>${card.template.storeCare.storeSelfCare.duration}天</td>
								</c:if>
								<td>${fns:calculateDurationMonth(card.beginTime,card.endTime)}
									个月</td>
								<td>${fns:formatDate(card.beginTime, "yyyy-MM-dd
									HH:mm:ss")}</td>
								<td>${fns:formatDate(card.endTime, "yyyy-MM-dd HH:mm:ss")}</td>
								<!--<td>${card.template.retail_price}</td>
							<td>${card.template.real_cost}</td>-->
								<td>${card.status==0?'可用':'不可用'}</td>
							</tr>
						</c:forEach>
					</tbody>
				</table>
			</div>
		</c:if>
		<c:if test="${member.currentCards.productCards[0]!=null}">
			<br />
			<div id="card_product">
				<table id="contentTable" data-role="table"
					class="ui-responsive table-stroke">
					<thead>
						<tr>
							<th colspan="9" style="text-align:center;">产品充值卡</th>
						</tr>
						<tr>
							<th>卡名</th>
							<th>适用产品</th>
							<th>卡内余额</th>
							<th>产品折扣</th>
							<th>当前状态</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${member.currentCards.productCards}" var="card">
							<tr>
								<td>${card.template.name}</td>
								<td>
									<ul>
										<c:forEach items="${card.template.productList}" var="detail">
											<li><c:if test="${detail.storeProduct.product_type==0}">${detail.storeProduct.product.name}</c:if>
												<c:if test="${detail.storeProduct.product_type==1}"></c:if>${detail.storeProduct.storeSelfProduct.name}</li>
										</c:forEach>
									</ul>
								</td>
								<td>${card.money}</td>
								<td>${card.productDiscount}</td>
								<td>${card.status==0?'可用':'不可用'}</td>
							</tr>
						</c:forEach>
					</tbody>
				</table>
			</div>
		</c:if>
		<c:if test="${member.currentCards.allCards[0]!=null}">
			<br />
			<div id="card_all">
				<table id="contentTable" data-role="table"
					class="ui-responsive table-stroke">
					<thead>
						<tr>
							<th colspan="9" style="text-align:center;">综合充值卡</th>
						</tr>
						<tr>
							<th>卡名</th>
							<th>卡内余额</th>
							<th>产品折扣</th>
							<th>护理折扣</th>
							<th>当前状态</th>
						</tr>
					</thead>
					<c:forEach items="${member.currentCards.allCards}" var="card">
						<tr>
							<td>${card.template.name}</td>
							<td>${card.money}</td>
							<td>${card.productDiscount}</td>
							<td>${card.careDiscount}</td>
							<td>${card.status==0?'可用':'不可用'}</td>
						</tr>
					</c:forEach>
					<tbody>
					</tbody>
				</table>
			</div>
		</c:if>
	</div>
</body>
</html>
